// web/src/app/api/(forum)/likes/route.ts

import {NextRequest, NextResponse} from "next/server";
import {db} from "@/lib/db";

export async function POST(req: NextRequest) {
    try {
        const json = await req.json()

        const like = await db.like.create({
            data: {
                ...json
            }
        })

        return NextResponse.json({like})
    } catch (err) {
        console.error(err)
        return NextResponse.json({err})
    }
}